<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>Document</title>
        <script src="http://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>
    </head>
    <body>
        <h1>使用detectmobilebrowser.js检测浏览器是否是移动端的</h1>
        <p>来源:<a href="http://detectmobilebrowsers.com/">http://detectmobilebrowsers.com/</a></p>
        <script src="detectmobilebrowser.min.js"></script>
        <script>
        $(function(){
            if(jQuery.browser.mobile){
                alert("这是移动端");
            }else{
                alert("这是pc端");
            }
        })
        </script>
    </body>
</html>